<%- include ('../public/page_header.ejs') %>



  <div class="container-fluid">
    <div class="row">

      <!--
                列表展示
            -->
      <div class="table-responsive">
        <table class="table table-bordered">
          <thead>
            <tr class="th">
              <th>模块名称</th>
              <th>节点类型</th>
              <th>操作名称</th>
              <th>操作地址</th>
              <th>排序</th>
              <th>描述</th>

              <th class="text-center">操作</th>
            </tr>
          </thead>
          <tbody>
            <%for(var i=0;i<list.length;i++){%>
              <tr>
                <td><%=list[i].module_name%></td>
                <td>     
                                <%if(list[i].type==1){%>
                                    模块
                                <%}else if(list[i].type==2){%>
                                    菜单
                                <%}else{%>
                                    操作
                                <%}%>
                </td>
                <td><%=list[i].action_name%></td>

                <td><%=list[i].url%></td>
                <td><%=list[i].sort%></td>

                <td><%=list[i].description%></td>
                    
                <td class="text-center"><a href="/<%=config.adminPath%>/access/edit?_id=<%=list[i]._id%>">修改</a></td>
              </tr>     
                    
              <%for(var j=0;j<list[i].items.length;j++){%>
                  <tr>
                      <td>----<%=list[i].items[j].module_name%></td>
                      <td>     
                          <%if(list[i].items[j].type==1){%>
                              模块
                          <%}else if(list[i].items[j].type==2){%>
                              菜单
                          <%}else{%>
                              操作
                          <%}%>
                      </td>
                      <td><%=list[i].items[j].action_name%></td>

                      <td><%=list[i].items[j].url%></td>
                      <td><%=list[i].items[j].sort%></td>

                      <td><%=list[i].items[j].description%></td>
                                      
                      <td class="text-center">
                        <a href="/<%=config.adminPath%>/access/edit?_id=<%=list[i].items[j]._id%>">修改</a> 
                        <a class="delete" href="/<%=config.adminPath%>/access/delete?_id=<%=list[i].items[j]._id%>&model=Access">删除</a>
                      </td>
                  </tr>

              <%}%>
                    
            <%}%>

    </tbody>
        </table>
      </div>

    </div>
  </div>
  </body>

  </html>